<!DOCTYPE html>

<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <meta charset="${response.charset}" />

  <title py:block="master_title">BlockMRS</title>
  <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/bootstrap.min.css')}" />
  <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/font-awesome.min.css')}" />
  <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/css/style.css')}" />

  <py:block name="head"></py:block>
</head>

<body>
  <!-- Navbar -->
  <nav class="navbar navbar-default">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-content">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="${tg.url('/')}">
        <img src="${tg.url('/img/logo.svg')}" height="100%" />
      </a>
    </div>

    <div class="collapse navbar-collapse" id="navbar-content">
      <ul class="nav navbar-nav">
        <li class="${('', 'active')[self.defined('page') and page=='index']}"><a href="${tg.url('/')}">Home</a></li>
      </ul>
      <ul py:if="tg.auth_stack_enabled" class="nav navbar-nav navbar-right">
        <li py:if="not request.identity"><a href="${tg.url('/login?signup=True')}">Sign Up</a></li>
        <li py:if="not request.identity"><a href="${tg.url('/login')}">Login</a></li>
        <li py:if="request.identity"><a href="${tg.url('/p/')}">User Portal</a></li>
        <li py:if="request.identity"><a href="${tg.url('/logout_handler')}">Logout</a></li>
        <li py:if="tg.predicates.has_permission('admin')"><a href="${tg.url('/admin')}">Admin</a></li>
      </ul>
    </div>
  </nav>


  <div class="container">
    <!-- Flash messages -->
    <py:with vars="flash=tg.flash_obj.render('flash', use_js=False)">
      <div class="row">
        <div class="col-md-8 col-md-offset-2">
          <div py:if="flash" py:replace="Markup(flash)" />
        </div>
      </div>
    </py:with>

    <!-- Main included content -->
    <py:block name="body"></py:block>
  </div>

  <!-- Footer -->
  <footer class="footer hidden-xs hidden-sm">
    <p>
      Copyright &copy; BlockMRS ${h.current_year()}
    </p>
  </footer>

  <script src="http://code.jquery.com/jquery.js"></script>
  <script src="${tg.url('/javascript/bootstrap.min.js')}"></script>
</body>
</html>
